<template>
  <div class="topic-detail">
    <!-- 顶部导航 -->
    <van-sticky>
      <van-nav-bar class="topNaV" @click-left="onClickLeft">
        <template #title>
          <p class="title">专题详情</p>
        </template>
        <template #left>
          <van-icon name="arrow-left" color="#666666" />
          <p class="left">返回</p>
        </template>
      </van-nav-bar>
    </van-sticky>
    <div v-html="obj.content"></div>

    <h2>专题推荐</h2>

    <div v-for="item in list" :key="item.id" class="good">
      <img :src="item.scene_pic_url" alt="" />
      <p>{{ item.title }}</p>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { topicdetai } from '@/api/topic'
const obj = ref({})
const list = ref([])
const router = useRouter()
const route = useRoute()
topicdetai({ id: route.params.id }).then(res => {
  obj.value = res.data
  list.value = res.recommendList
})
const onClickLeft = () => {
  router.back()
}
</script>
<script>
export default {
  name: 'topicDetail'
}
</script>
<style>
img {
  width: 750px;
}</style>
<style lang="scss" scoped>
.topic-detail {
  background-color: #f8f8f8;
  .topNav {

    .left {
      font-size: 31.2px;
      color: #666666;
      letter-spacing: 0;
      font-weight: 400;
    }

    .title {
      font-size: 36px;
      color: #333333;
      letter-spacing: 0;
      font-weight: 500;
    }
  }
  h2 {
    font-size: 38px;
    color: #333333;
    letter-spacing: 0;
    font-weight: 500;
    height: 53px;
    line-height: 53px;
    margin: 60px auto 40px;
    text-align: center;
  }
  .good {
    width: 710px;
    margin: 0 auto;
    margin-bottom: 30px;
    overflow: hidden;
    background-color: #ffffff;
    img {
      width: 710px;
      height: 343px;
    }
    p {
      font-size: 30px;
      color: #333333;
      letter-spacing: 0;
      font-weight: 500;
      height: 42px;
      line-height: 42px;
      margin: 32px 0 52px;
      margin-left: 42px;
      text-align: left;
    }
  }
}
</style>
